// get 请求打印参数
// http://localhost:3000/?user=jspang&age=18  例如仿问
const Koa=require('koa');
const Router=require('koa-router');
const app=new Koa();

const router =new Router({
    prefix:'/jspang' //前缀
});

router.get('/',(ctx,next)=>{
             ctx.body="Hello jspang"
        })
    .get('/todo',(ctx,next)=>{
        ctx.body="todo page";
    })

app
    .use(router.routes())
    .use(router.allowedMethods());
app.listen(3000,()=>{
    console.log("starting at port 3000")
})
